package cn.tedu.basic;
/**本类用于复习while循环*/
public class TestWhile {
    public static void main(String[] args) {
       f1();
       f2();
       f3();
       f4();
       f5();
    }

    private static void f5() {
        int i = 2;
        int sum = 0;
        while (i<=100){
            sum=sum+i;
            i+=2;
        }
        System.out.println(sum);
    }

    private static void f4() {
        int i = 1;
        int sum = 0;
        while (i<=10){
            sum = sum+i;
            i++;
        }
        System.out.println(sum);
    }

    private static void f3() {
        int num = 1;
        while (num<=100){
            if (num%2!=0){
                System.out.println(num);
            }
            num++;
        }
    }

    private static void f2() {
        int num = 1;
        while (num<=10){
            System.out.println(num);
            num++;
        }
    }

    private static void f1() {
        int count=1;
        while (count<=10){
            System.out.println("小可爱");
            count++;
        }
    }
}
